<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" id="myInput" onkeyup="method01(event)" ><span id="mySpan"></span>
</body>
<script>
  function method01(event){
      console.log(event);
      console.log(event.key);
      console.log(event.keyCode);
  }
</script>
</html>